#include "GUISinglePlayer.h"

GUISinglePlayer::GUISinglePlayer( QWidget* parent ) : QMainWindow( parent )
{
	ui.setupUi( this );
	QObject::connect( ui.mapBestandButton, SIGNAL(clicked()), this, SLOT(mapFileClicked()) );
	QObject::connect( ui.bestandButton, SIGNAL(clicked()), this, SLOT(fileClicked()) );
	QObject::connect( ui.laadButton, SIGNAL(clicked()), this, SLOT(loadClicked()) );
	QObject::connect( ui.startButton, SIGNAL(clicked()), this, SLOT(startClicked()) );
}

GUISinglePlayer::~GUISinglePlayer( )
{
}

void GUISinglePlayer::mapFileClicked( )
{
	GUILoadMapDialog nieuw( this );
	if( nieuw.exec() == QDialog::Accepted )
	{
		ui.mapEdit->setText( nieuw.getMapId() );
	}
}

void GUISinglePlayer::fileClicked( )
{
	QString filename = QFileDialog::getOpenFileName( this, "Kies een bestaand spel", "." );
	if( !filename.isEmpty() )
		ui.bestandsnaamEdit->setText( filename );
}

void GUISinglePlayer::loadClicked( )
{
}

void GUISinglePlayer::startClicked( )
{
	QString kleur = ui.kleurComboBox->currentText();

}
